package org.smile.homework02.hyl;

public interface Generator {
    default String generateType() {
        int random = generateDecimal();
        switch (random) {
            case 0:
            case 1:
            case 2:
            case 3:
                return "小";
            case 4:
            case 5:
            case 6:
            case 7:
                return "中";
            case 8:
            case 9:
            default:
                return "大";
        }
    }

    default int generateDecimal() {
        return (int) (Math.random() * 10);
        // *100000  1 ~ 99999
        //粤A·0T898
        //4, 5 ,456,  32314
        // 03350
    }

    default String generateNumber() {
        StringBuffer number = new StringBuffer();
        for (int i = 0; i < 5; i++) {
            int random = generateDecimal();
            number.append(random);   // "","4","45","452","4529","45291"
            // "45563"
        }
        return number.toString();
    }
}
